package com.jic.order.controller.manage;

import com.jic.common.base.vo.RestResult;
import com.jic.order.manage.request.OrderDistributionMemberRequest;
import com.jic.order.manage.request.OrderSaleReportRequest;
import com.jic.order.manage.response.OrderDistributionMembertResponse;
import com.jic.order.manage.response.OrderSaleReportResponse;
import com.jic.common.base.vo.PageResult;
import com.jic.order.service.OrderParentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags = "后台-父订单管理")
@RestController
@RequestMapping(value = "orderParentManager")
public class OrderParentManagerController {

    @Autowired
    private OrderParentService orderParentService;

    @ApiOperation(value = "销售订单报表")
    @PostMapping("querySaleOrderReportPage")
    public RestResult<PageResult<OrderSaleReportResponse>> querySaleOrderReportPage(@RequestBody OrderSaleReportRequest orderSaleReportRequest) {
        return orderParentService.querySaleOrderReportPage(orderSaleReportRequest);
    }

    @ApiOperation(value = "代销员列表")
    @PostMapping("queryOrderDistributionListPage")
    public RestResult<PageResult<OrderDistributionMembertResponse>> queryOrderDistributionListPage(@RequestBody OrderDistributionMemberRequest request) {
        return orderParentService.queryOrderDistributionListPage(request);
    }

    @ApiOperation(value = "代销员订单详情")
    @PostMapping("queryOrderDistributionInfoList")
    public RestResult<PageResult<OrderDistributionMembertResponse>> queryOrderDistributionInfoList(@RequestBody OrderDistributionMemberRequest request) {
        return orderParentService.queryOrderDistributionInfoList(request);
    }

}
